package labox.innovation.gameserver.pathfinding.geonodes;

import labox.innovation.gameserver.model.Scene;
import labox.innovation.gameserver.pathfinding.AbstractNodeLoc;

/**
 * 
 * @author -Nemesiss-
 */
public class GeoNodeLoc extends AbstractNodeLoc {

	private final short _x;

	private final short _y;

	public GeoNodeLoc(short x, short y) {
		_x = x;
		_y = y;
	}

	/**
	 * @see labox.innovation.gameserver.pathfinding.AbstractNodeLoc#getX()
	 */
	@Override
	public int getX() {
		return _x * 128 + 48;
	}

	/**
	 * @see labox.innovation.gameserver.pathfinding.AbstractNodeLoc#getY()
	 */
	@Override
	public int getY() {
		return _y * 128 + 48;
	}

	@Override
	public int getNodeX() {
		return _x;
	}

	@Override
	public int getNodeY() {
		return _y;
	}

	/**
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + _x;
		result = prime * result + _y;
		return result;
	}

	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		GeoNodeLoc _obj = (GeoNodeLoc) obj;
		if (_x != _obj._x)
			return false;
		if (_y != _obj._y)
			return false;
		return true;
	}

}
